<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head><title>DDL - Create Database</title>

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="expires" content="" />
<meta name="lang" content="en-US" />
<meta name="template-info" content="topic.htm 2012-03-19 usp" />
<meta name="creation-date" scheme="iso8601" content="2013-06-23" />
<meta name="last-modified" scheme="iso8601" content="2013-06-23" />
<meta name="publish-date" scheme="iso8601" content="" />
<meta name="version" content="1" />
<meta name="author" content="USP" />
<meta name="robots" content="follow" />
<meta name="category" content="Programming/Database/Firebird" />
<meta name="keywords" content="programming, database, Firebird, SQL, documentation." />
<meta name="description" content="" />

<link rel="stylesheet" type="text/css" href="../../../includes/topic-2.css" />
<link rel="stylesheet" type="text/css" href="../local.css" />

<script language="JavaScript" type="text/javascript" src="../../../includes/global.js"></script>
<script language="JavaScript" type="text/javascript" src="../../../includes/cookies.js"></script>
<script language="JavaScript" type="text/javascript" src="../../../includes/topic.js"></script>

</head><body class="content" onload="onloadTopic()"><a name="top"></a>

<h1>Create Database</h1>

<pre class="syntax">
Create { <i>database</i> | <i>schema</i> } '<a href="#filespec">file-specifier</a>'
    [ user '<a href="#cred">username</a></i>' [ password '<a href="#cred">password</a>' ] ]
    [ page_size = <a href="#pagesize">integer-size</a> ]
    [ length <a href="#length">integer-number</a> [ page | pages ] ]
    [ default character set <a href="#charset">character-set</a> ]
    [ <a href="#secondfile">secondary-file-list</a> ]
</pre>

<h5><a name="filespec">file-specifier</a></h5>

<p>A plattform specific file specifier which points to the database file. Example (Windows):</p>

<pre class="codebox">
d:\data\application-name\database-filename.fdb
</pre>

<h5><a name="cred">username, password</a></h5>

<p>When a client attaches to a database, these credentials must be provided. The values are check against the <a href="#">security database</a>, which usually resides on the database server, and should not be accessible to users.</p>

<p>User name and password are mandatory on Windows and Netware.</p>

<h5><a name="pagesize">page-size</a></h5>

<p>Page size can be any of 1024 (default), 2048, 4096 or 8192.</p>
<p>With Firebird 2.5, the page size can be any value (???).</p>

<h5><a name="length">length</a></h5>

<p>Specifies the length in number of pages of a primary or secondary database file. Use for primary file only if defining a secondary file in the same statement.</p>

<h5><a name="charset">default character set</a></h5>

<p>Specifies which character set is used for the database by default. If no charset value is given, <tt>None</tt> is assumed.</p>

<h5><a name="secondfile">Secondary Files</a></h5>

<p>One or more files to hold database pages after the primary file is filled. The secondary-file-list is defined as follows:</p>

<pre class="syntax">
secondary-file-list : : = <i>file file-specifier</i> [ <i>file file-specifier</i> ]...
file-specifier : : = 'file-name' [ <i>file-info</i> ]
file-info : : = [ <i>length-spec</i> ] [ <i>start-spec</i> ]
length-spec : : = length <i>integer-value</i> [ page | pages ]
start-spec : : = starting [ at [ page ] ] <i>integer-value</i>
</pre>

<p>The <i>file-name</i> is a operating system file name specifier, and may be followed by a length and start page secification.</p>

<div class="footer"><hr />
<p>Page author: USP &bull; Page editor: USP &bull; Last update: 2013-06-06 &bull; 1</p>
<p>&copy; 2013 Synesis Ulrich Sprick. All rights reserved. See <a href="../../../copyright.htm">Copyright details</a>.</p>
<p><a href="#top">Back to Top</a> | <a href="../../../index.htm" target="_top">Home</a> | <a id="reload" onclick="reloadFrameset()" href ="../../../index.htm" target="_top" >Reload Frameset</a></p>
</div></body></html>
